<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>{$Think.lang.collection_content}</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    {include file="public/file_css"}
    <style type="text/css">
        .layui-table-cell{
            text-align:center;
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
        }
        .layui-table img{
            max-width:100%
        }
    </style>
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">

        <fieldset style="display: none;" id="inputSearch" class="table-search-fieldset">
            <legend>{$Think.lang.search_info}</legend>
            <div style="margin: 10px 10px 10px 10px">
                <form id="searchData" lay-filter="searchData" onsubmit="return false;" class="layui-form layui-form-pane" action="">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">{$Think.lang.link_title}</label>
                            <div class="layui-input-inline">
                                <input type="text" name="title" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <button type="submit" class="layui-btn layui-btn-primary" id="doSearch" lay-submit lay-filter="doSearch""><i class="layui-icon"></i>{$Think.lang.search}</button>
                        </div>
                    </div>
                </form>
            </div>
        </fieldset>

        <!--头部工具栏-->
        <div id="toolbarDemo" style="display: none;background: #fff;">
            <input type="hidden" id="cid" value="{$id}">
            <span id="FieldUrl" alt="{:url('updateField')}" style="display: none"></span>
            <span id="SwitchUrl" alt="{:url('switchAt')}" style="display: none"></span>
            <span id="JumpUrl" alt="{:url('select')}" style="display: none"></span>
            <span id="AddUrl" alt="{:url('addc')}?cid={$id}" style="display: none"></span>
            <button class="layui-btn layui-btn-normal layui-btn-sm" lay-event="adds"> {$Think.lang.add} </button>
            <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="delete"> {$Think.lang.batchDel} </button>
            <button class="layui-btn layui-btn-sm layui-btn-normal" type="button" lay-event="importSelect">
                {$Think.lang.collection_import_select}
            </button>
            <a class="layui-btn layui-btn-sm layui-btn-normal" href="{:url('collection/importAll')}?id={$Request.get.id}">
                {$Think.lang.collection_import_all}
            </a>
            <a class="layui-btn layui-btn-sm" href="/admin/collection/">{$Think.lang.collection_return}</a>
        </div>
        <!--数据-->
        <table class="layui-hide" id="DataDemos" lay-filter="DataDemos"></table>
        <!--操作-->
        <script type="text/html" id="toolBar">
            <span id="DelUrl" alt="{:url('delAll')}" style="display: none"></span>
            <span id="ActionUrl" alt="{:url('edits')}" style="display: none"></span>
            <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edits">{$Think.lang.edit}</a>
            <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">{$Think.lang.del}</a>
        </script>

    </div>
</div>
{include file="public/file_js"}
<script>
    layui.use(['form', 'table'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table;
        let id=$("#cid").val();
        table.render({
            elem: '#DataDemos',
            url: '{:url("conlist")}',
            toolbar: '#toolbarDemo',
            method: 'get',
            page: true,  //开启分页
            limit: 10,  //默认10条
            where:{id:id},
            defaultToolbar: ['filter', 'exports', 'print', {
                title: '{$Think.lang.search}',
                layEvent: 'laySearch',
                icon: 'layui-icon layui-icon-search'
            }],
            cols: [[
                {type: "checkbox", width: 50},
                {field: 'id', align:"center", width: 80, title: 'ID', sort: true},
                {field: 'url', align: 'center',title: 'url'},
                {field: 'title', align: 'center',title: '{$Think.lang.variable_title}'},
                {field: 'status', align: 'center',title: '{$Think.lang.status}'},
                {title: '{$Think.lang.operate}', width: 120, toolbar: '#toolBar', align: "center"}
            ]],
        });
    });
</script>

</body>
</html>